package com.qf;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author Wy
 * @version V1.0
 * @Project MavenDemo
 * @Package com.qf
 * @Description:
 * @Date 2022/7/6 11:28
 */
@SpringBootApplication
//表名是一个客户端
@EnableEurekaClient
@EnableFeignClients(basePackages = {"com.qf.feign"})
public class CustomerApplication {

    public static void main(String[] args) {
        SpringApplication.run(CustomerApplication.class, args);
    }

    @Bean
    //给远程调用对象中加入接口负载均衡技术, 默认轮询策略
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
